package com.watercloud.controller;

import com.pojo.Device;
import com.pojo.Update;
import com.watercloud.service.DeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/device")
public class DeviceController {
    @Autowired
    DeviceService deviceService;

    @RequestMapping("/getDevice")
    public List<Device> getDevice(Device device) {
        return deviceService.selectDevice(device);
    }

    @RequestMapping("/updateDevice")
    public boolean updateDevice(Update update){
        boolean res = deviceService.updateDevice(update);
        return res;
    }

}
